import React, { Component } from 'react'
import { useDispatch, useHistory } from 'umi'


const Home = () => {

  const dispatch = useDispatch()
  const history = useHistory()

  return <div>

    <button onClick={() => {
      dispatch({
        type: 'book/postData',
        data: {
          page: 1,
          size: 5
        }
      })
      history.push('/blogs/blogsDetail')
    }}>传递给 detail页面</button>
  </div>
}

export default Home;


// export default class index extends Component {
//   render() {
//     return (
//       <div>
//         blogsHome
//       </div>
//     )
//   }
// }
